const typeset = async (element) => {
  if (!window.MathJax || !window.MathJax.startup) { return; }
  window.MathJax.startup.promise
    .then(() => window.MathJax.typesetPromise([element]))
    .catch((err) => console.log(`Typeset failed: ${err.message}`));
};

export default typeset;
